﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace GameCore
{
    public class GlobalDefine
    {
        public static ContentManager Content;
        public static GameWindow Window;
        public static GameState now_gamestate;
        public static SpriteBatch spriteBatch;

        public static bool playing = true;


        public static void CreateGlobalResource(ContentManager content, GameWindow window, SpriteBatch _spriteBatch)
        {
            Content = content;
            Window = window;
            spriteBatch = _spriteBatch;
        }

        public static Color GetPixexFormTexture(Texture2D texture, Point point)
        {
            Color[] re = new Color[texture.Width * texture.Height];
            texture.GetData<Color>(re);
            return re[point.Y * texture.Width + point.X];
        }
    }
}
